import request from '@/utils/request'

/**
 *通过工单查询工单相关数据
 * @param selectShopOrders
 */
export function selectShopOrders(data, page) {
  return request({
    url: `/md/shopOrders/queryAllOrder?page=${page.page}&pageSize=${page.pageSize}`,
    method: 'post',
    data
  })
}

/**
 * 修改工单固定交期
 * @param updateFixedTime
 */
export function updateFixedTime(data) {
  return request({
    url: `/md/shopOrders/updateFixedTime`,
    method: 'put',
    params: data
  })
}

/**
 * 修改工单紧急状态
 * @param updateEmergenc
 */
export function updateEmergenc(data) {
  return request({
    url: `/md/shopOrders/updateEmergenc`,
    method: 'put',
    data
  })
}

/**
 * 工单绑定
 * @param bindShopOrders
 */
export function bindShopOrders(data) {
  return request({
    url: `/pp/schedule/work/order/add`,
    method: 'post',
    data
  })
}
/**
 * 工单解绑
 * @param unbindShopOrders
 */
export function unbindShopOrders(data) {
  return request({
    url: `/pp/schedule/work/order/delete`,
    method: 'post',
    data
  })
}
/**
 * 产线指配
 * @param assignedLine
 */
export function assignedLine(data, page) {
  return request({
    url: `/pp/schedule/work/order/assignedLine?page=${page.page}&pageSize=${page.pageSize}`,
    method: 'post',
    data
  })
}
/**
 * 机台指配
 * @param assignedBand
 */
export function assignedBand(data) {
  return request({
    url: `/pp/schedule/work/order/assignedBand`,
    method: 'post',
    data
  })
}
/**
 * 保存订单池
 * @param saveSchedule
 */
export function saveSchedule(data) {
  return request({
    url: `/pp/schedule/work/order/save`,
    method: 'post',
    data
  })
}
/**
 * 删除
 * @param deleteSwitchTime
 */
export function deleteSwitchTime(data) {
  return request({
    url: `/pp/p/switchTime/delete`,
    method: 'post',
    data
  })
}
